<%@ page 
    language="java" contentType="text/html; charset=UTF-8"
    import="ecs.dogear.app.*"
    pageEncoding="UTF-8"%>
    <%
    int userId = Integer.parseInt(request.getParameter("userId"));
    String commentStr = StringUtil.parse(request.getParameter("content").trim());
    String url = request.getParameter("url");
    String title = StringUtil.parse(request.getParameter("title"));
    int i = 1;
    while(CommenterDatabase.getComment(i) != null) i++;
    AddCommentTransaction act = new AddCommentTransaction(userId,url,commentStr,i,title);
    act.execute();
    String handler = request.getParameter("callback");
    out.println(handler + "({commentId:'"+i+"'})");
    %>
